home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 3⁄9⁄90 / 0816-Re Cancelling a New -Mar90 < prev    next >
Encoding:
Text File  |  1990-03-09  |  928 b   |  38 lines  |  [TEXT/GEOL]

  1. Item    5139978                         5-March-90        17:09PST
  2.  
  3. From:   D1165                           Esha, David C Hands,PRT
  4.  
  5. To:     D5780                           Stat-Ease, Robert Altman,PRT
  6.  
  7. cc:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    Re: Cancelling a New Document
  10.  
  11.  
  12. If you post a dialog in DoInitialState and the user cancels… Then install an
  13. error handler to "fail silently" and exit the dialog. Something like this:
  14.  
  15. PROCEDURE TDoc.DoInitialState; OVERRIDE;
  16.  
  17.     PROCEDURE HandleCnclErr(err: OSerr; msg: LONGINT);
  18.      BEGIN
  19.         aWindow.Close;   {or aDialog.Close}
  20.      END;
  21.  
  22. BEGIN
  23.   {…code for creating aWindow view and finding aDialog subview…}
  24.    CatchFailures(fi, HandleCnclErr);
  25.    diss := aDialog.poseModally;
  26.    IF diss = 'cncl' THEN
  27.    failure(noErr, 0)        {fail silently}
  28.    ELSE BEGIN
  29.    END;
  30.    aWindow.Close;
  31.    Success(fi);
  32. END;
  33.  
  34.  
  35. David Hands
  36. ESHA Research
  37.  
  38.